package com.example.interview.controller;

import com.example.interview.common.Common;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("chat")
public class ChatController {

  @GetMapping("joinRoom")
  public String joinRoom(String roomId,String userId) {
    return Common.joinRoom(roomId, userId);
  }

  @GetMapping("leaveRoom")
  public String leaveRoom(String roomId,String userId) {
    return Common.leaveRoom(roomId, userId);
  }

  @GetMapping("createRoom")
  public String createRoom(String roomId) {
    return Common.createRoom(roomId);
  }

  @GetMapping("createPerson")
  public String createPerson(String userId) {
    return Common.createPerson(userId);
  }
}
